﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CreditLimitM.aspx.cs" Inherits="SysManage_Others_CreditLimitM" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxUploadControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v11.1.Export, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView.Export" TagPrefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.5.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxClasses" tagprefix="dx" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>信用额度维护</title>
    <%--<link href="../../CSS/SubStyle.css" rel="stylesheet" type="text/css" />--%>
    <link href="../../Styles/main.css" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" src="../../Jscript/common.js" defer="defer"></script>
    <script type="text/javascript" src="../../Jscript/wyyjs.js"></script>
    <script type="text/javascript" language="javascript">
        function boundvalid() {
            boundsource("txtSegment", "^.+$", "不能为空--Not null", "cmdAdd,cmdEdit");
            boundsource("ddlCoDep", "[^-1]", "请选择-Please Select.", "cmdAdd,cmdEdit");
            boundsource("txtHead", "^.+$", "不能为空--Not null", "cmdAdd,cmdEdit");
            boundsource("txtFoot", "^.+$", "不能为空--Not null", "cmdAdd,cmdEdit");
        }
    </script>
</head>
<body style="background-color: #AABFD2;">
    <form id="form1" runat="server">
        <div id="headlocation" class="headlocation" style="text-align:left;">
            <asp:Label ID="Label2" runat="server" Text="当前位置"></asp:Label>
            <img alt="当前位置" src="../../Image/weizhi.gif" />>>
            <asp:Label ID="Label12" runat="server" Text="信用额度维护"></asp:Label>
        </div> 
        <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
        <asp:UpdatePanel ID="Upd" runat="server">
            <ContentTemplate>
                <div>
                    <ul>
                        <li class="li2">
                            <asp:Label ID="Label4" runat="server" CssClass="mclbldiv" Text="类型："></asp:Label>
                            <dx:ASPxComboBox ID="ddlType" runat="server" CssClass="floatleft" 
                                ValueType="System.String" Width="215px" SelectedIndex="0" 
                                AutoPostBack="True" onselectedindexchanged="ddlType_SelectedIndexChanged">
                                <Items>
                                    <dx:ListEditItem Selected="True" Text="客户" Value="0" />
                                    <dx:ListEditItem Text="订单" Value="1" />
                                </Items>
                            </dx:ASPxComboBox>
                            <span class="red">*</span>
                        </li>
                    </ul>
                    <ul>
                        <li class="li2">
                            <asp:Label ID="Label7" runat="server" CssClass="mclbldiv" Text=""></asp:Label>
                            <dx:ASPxComboBox ID="ddlTypeValue" runat="server" CssClass="floatleft" 
                                ValueType="System.String" Width="215px" AutoPostBack="True" 
                                DropDownStyle="DropDown" ontextchanged="ddlTypeValue_TextChanged">
                            </dx:ASPxComboBox>
                            <span class="red">*</span>
                        </li>
                    </ul>
                    <ul>
                        <li class="li2">
                            <asp:Label ID="Label3" runat="server" CssClass="mclbldiv" Text="金额："></asp:Label>
                            <asp:TextBox runat="server" ID="txtAmount" Text="0" CssClass="mctxt floatleft"
                                onblur="txtIsNumberOnly(this.id);"></asp:TextBox>
                            <span class="red">*</span>
                        </li>
                    </ul>
                    <ul>
                        <li class="li2">
                            <asp:Label ID="Label1" runat="server" CssClass="mclbldiv" Text="有效起始日期："></asp:Label>
                                <dx:ASPxDateEdit ID="txtValidDate" runat="server" CssClass="floatleft" 
                                    DisplayFormatString="yyyy-MM-dd" EditFormat="Custom" 
                                    EditFormatString="yyyy-MM-dd" Width="215px"
                                    DateOnError="Today">
                                </dx:ASPxDateEdit>
                                <span class="red">*</span>
                        </li>
                    </ul>
                    <ul>
                        <li class="li2">
                            <asp:Label ID="Label8" runat="server" CssClass="mclbldiv" Text="有效中止日期："></asp:Label>
                                <dx:ASPxDateEdit ID="txtInValidDate" runat="server" CssClass="floatleft" 
                                    DisplayFormatString="yyyy-MM-dd" EditFormat="Custom" 
                                    EditFormatString="yyyy-MM-dd" Width="215px" DateOnError="Today">
                                </dx:ASPxDateEdit>
                            <span class="red">*</span>
                        </li>
                        <li class="li2">
                            <asp:Label ID="Label5" runat="server" CssClass="mclbldiv" Text="备注："></asp:Label>
                             <asp:TextBox runat="server" ID="txtRemarks" Text="" CssClass="mctxt" style="width:50%;"></asp:TextBox>
                        </li>
                    </ul>
                    <ul>
                        <li class="li2" style="text-align:left;">
                            <asp:Label ID="Label6" runat="server" CssClass="mclbldiv"></asp:Label>                            
                            <asp:Button ID="btnAdd" runat="server" CssClass="cmdStyle" Text="添 加" onclick="btnAdd_Click" 
                                 />                            
                            <asp:Button ID="btnSave" runat="server" CssClass="cmdStyle" Text="保 存" 
                               Visible="false" onclick="btnSave_Click" />
                            <asp:Button ID="btnExport" runat="server" CssClass="cmdStyle" 
                                OnClick="btnExport_Click" style="margin-left:20px;" Text="导 出" />
                            <asp:Button ID="btnReset" runat="server" CssClass="cmdStyle" 
                                OnClick="btnReset_Click" style="margin-left:20px;" Text="重 置" />
                        </li>
                    </ul>
                </div>
              <fieldset class="fieldset2">
                <legend><label class="lblfieldset">数据列表</label></legend>
                <div style="margin:0 0 5px 0; width:1195px;">
                   <%-- <div class="lblfieldset" style="font-weight:bold;">已有数据</div>--%>
                    <dx:ASPxGridView ID="gv" runat="server" 
                        AutoGenerateColumns="False" ClientInstanceName="gv" 
                        KeyFieldName="CreditLimitID" Width="100%" 
                        OnAfterPerformCallback="gv_AfterPerformCallback" 
                        OnRowCommand="gv_RowCommand" >
                        <Columns>
                            <dx:GridViewDataTextColumn Caption="序号" FieldName="rowindex" Width="50px" 
                                ReadOnly="True">
                                <Settings AllowAutoFilter="False" />
                                <CellStyle HorizontalAlign="Center">
                                </CellStyle>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="类型" FieldName="TypeShow" Width="80px">                                
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="客户" FieldName="TypeValueShow0" Width="220px">
                                <CellStyle HorizontalAlign="Left"></CellStyle>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="订单" FieldName="TypeValueShow1" Width="120px">
                                <CellStyle HorizontalAlign="Right"></CellStyle>
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="金额" FieldName="Amount" 
                                Width="110px" UnboundType="Decimal">
                                <Settings AutoFilterCondition="GreaterOrEqual" />
                                <PropertiesTextEdit DisplayFormatString="N2" />
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataDateColumn Caption="有效起始日期" FieldName="ValidDate" Width="110px" 
                                UnboundType="DateTime">
                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataDateColumn Caption="有效中止日期" FieldName="InValidDate" Width="110px" 
                                UnboundType="DateTime">
                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataDateColumn Caption="更新日期" FieldName="UPDATEDATE" Width="110px" 
                                UnboundType="DateTime">
                                <PropertiesDateEdit DisplayFormatString="{0:yyyy-MM-dd}"></PropertiesDateEdit>
                            </dx:GridViewDataDateColumn>
                            <dx:GridViewDataTextColumn Caption="更新人" FieldName="UpdatePerson" Width="160px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataTextColumn Caption="状态" FieldName="StateText" Width="160px">
                            </dx:GridViewDataTextColumn>
                            <dx:GridViewDataColumn Caption="编辑" Width="40px">
                                <DataItemTemplate>
                                    <asp:ImageButton ID="imgbtnDelete" runat="server" AlternateText="编辑"
                                        CommandArgument='<%# Eval("CreditLimitID") %>' CommandName="edit"
                                        ImageUrl="../../Image/edit.gif" />
                                </DataItemTemplate> 
                                <CellStyle HorizontalAlign="Center">
                                </CellStyle>
                            </dx:GridViewDataColumn>
                            <dx:GridViewDataColumn Caption="删除" Width="40px">
                                <DataItemTemplate>
                                    <asp:ImageButton ID="Button1" runat="server" 
                                    CommandArgument='<%# Eval("CreditLimitID") %>'
                                        CommandName="delete" ToolTip="删除" Text="删除" ImageUrl="~/Image/del.gif" 
                                        OnClientClick="return confirm('你确定要删除');" />
                                </DataItemTemplate>
                                <CellStyle HorizontalAlign="Center">
                                </CellStyle>
                            </dx:GridViewDataColumn>
                        </Columns>
                        <SettingsBehavior ColumnResizeMode="Control" AllowSelectByRowClick="True" 
                            SortMode="DisplayText"></SettingsBehavior>
                        <Settings ShowFilterRow="True" ShowGroupPanel="True" ShowFilterRowMenu="true"                        
                            ShowFilterBar="Visible" ShowFooter="True">
                        </Settings>
                    </dx:ASPxGridView>                    
                </div>
              </fieldset>
                <div id="exportdiv" runat="server" style="margin:15px 0 15px 0; text-align:center;">                                    
                    <dx:ASPxGridViewExporter ID="grid" runat="server" GridViewID="gv">
                    </dx:ASPxGridViewExporter>
                </div>
                <asp:UpdateProgress ID="UpdateProgress3" runat="server">    
                    <ProgressTemplate>
                        <div style="text-align:center; width:100%;"><span style="font-size:16px; color:Blue;">Data Loading..... </span></div>             
                    </ProgressTemplate>
                </asp:UpdateProgress>
                <asp:HiddenField ID="hidid" Value="0" runat="server" />
                <asp:HiddenField ID="hidadd" Value="0" runat="server" />
            </ContentTemplate>
             <Triggers>
                <asp:PostBackTrigger ControlID="btnExport" />
            </Triggers>
        </asp:UpdatePanel>
    </form>
</body>
</html>
